import {
  Dashboard,
  Login,
  NotFound,
  ArticalList,
  ArticalEdit,
  Settings,
  Notifications,
  NoAuth,
  Profile
} from '../views';

export const mainRoutes = [
  //这些组件渲染的都是和App同级的
  {
    pathname: '/login',
    component: Login
  },
  {
    pathname: '/404',
    component: NotFound
  }
];
export const adminRoutes = [
  //这个数组需要被侧边栏去遍历，要注意数组的顺序
  {
    pathname: '/admin/dashboard',
    component: Dashboard,
    title: '仪表盘',
    icon: 'dashboard', //title是用于在侧边栏展示的
    isNav: true,
    roles: ['001', '002', '003']
  },
  {
    pathname: '/admin/artical',
    component: ArticalList,
    exact: true, //精确匹配
    title: '文章管理',
    icon: 'unordered-list',
    isNav: true,
    roles: ['001', '002']
  },
  {
    pathname: '/admin/artical/edit/:id', //动态路由
    component: ArticalEdit,
    title: '文章编辑',
    roles: ['001']
  },
  {
    pathname: '/admin/settings',
    component: Settings,
    title: '设置',
    isNav: true,
    icon: 'setting',
    roles: ['001']
  },
  {
    pathname: '/admin/notifications',
    component: Notifications,
    roles: ['001', '002', '003']
  },
  {
    pathname: '/admin/noauth',
    component: NoAuth,
    roles: ['001', '002', '003']
  },
  {
    pathname: '/admin/profile',
    component: Profile,
    roles: ['001', '002', '003']
  }
];
